window.addEventListener('DOMContentLoaded', () => {
    const replaceText = (selector, text) => {
      const element = document.getElementById(selector)
      if (element) element.innerText = text
    }
  
    for (const type of ['chrome', 'node', 'electron']) {
      replaceText(`${type}-version`, process.versions[type])
    }
})

// preload.js
window.closeApp = function() {
  // 发送关闭信号给主进程
  require('electron').ipcRenderer.send('close-app');
}